// 随机数 [n, m]
export function randomNum(minNum, maxNum) {
    switch (arguments.length) {
        case 1:
            return Math.floor(Math.random() * minNum + 1);
        case 2:
            return Math.floor(Math.random() * (maxNum - minNum + 1) + minNum);
        default:
            return 0;
    }
}

const colors  = [
    "#ed1941","#1B9637","#2E2AA4", "#ffe600",
    "#feeeed","#5f3c23", "#5e7c85"];

export function generateRandomColor() {
    let index = randomNum(0, colors.length -1);
    return colors[index];
}